import {PersonOutline, SettingsOutline} from '@vicons/ionicons5'
import {PeopleLock20Regular, Organization20Regular} from '@vicons/fluent'
import {BookOutline} from '@vicons/ionicons5'
// 路由元信息
export const routeMeta = {
    name: {
        NOT_FOUND: 'NotFound',
        HOME: 'Home',
        LOGIN: 'Login',
        SYS_USER: 'SysUser',
        SYS_ROE: 'SysRole',
        SYS_ORGANIZATION: 'SysOrganization',
        SYS_DICT: 'SysDict'
    },
    path: {
        NOT_FOUND: '/:pathMatch(.*)*',
        HOME: '/',
        LOGIN: '/login',
        SYS_USER: 'user',
        SYS_ROE: 'role',
        SYS_ORGANIZATION: 'organization',
        SYS_DICT: 'dict'
    }
}

export const routes = [
    {
        path: 'sys',
        name: 'Sys',
        meta: {
            title: '系统管理',
            icon: SettingsOutline,
            permission: 'sys',
            // false 显示菜单 true 隐藏菜单(false可以省略不写)
            hidden: false
        },
        children: [
            {
                path: routeMeta.path.SYS_USER,
                name: routeMeta.name.SYS_USER,
                component: () => import('@/views/sys/user/index.vue'),
                meta: {
                    title: '用户管理',
                    icon: PersonOutline,
                    permission: 'sys:user',
                    // 页面内部操作按钮的权限
                    actions: {
                        query: 'sys:user:query',
                        create: 'sys:user:create',
                        update: 'sys:user:update',
                        delete: 'sys:user:delete',
                        resetPassword: 'sys:user:resetPassword',
                        lock: 'sys:user:lock',
                        unlock: 'sys:user:unlock'
                    }
                }
            },
            // 角色管理
            {
                path: routeMeta.path.SYS_ROE,
                name: routeMeta.name.SYS_ROE,
                component: () => import('@/views/sys/role/index.vue'),
                meta: {
                    title: '角色管理',
                    icon: PeopleLock20Regular,
                    permission: 'sys:role',
                    actions: {
                        query: 'sys:role:query',
                        create: 'sys:role:create',
                        update: 'sys:role:update',
                        delete: 'sys:role:delete',
                    }
                }
            },
            // 组织机构
            {
                path: routeMeta.path.SYS_ORGANIZATION,
                name: routeMeta.name.SYS_ORGANIZATION,
                component: () => import('@/views/sys/organization/index.vue'),
                meta: {
                    title: '组织机构',
                    icon: Organization20Regular,
                    permission: 'sys:organization',
                    actions: {
                        create: 'sys:organization:create',
                        update: 'sys:organization:update',
                        delete: 'sys:organization:delete',
                    }
                }
            },
            // 字典管理
            {
                path: routeMeta.path.SYS_DICT,
                name: routeMeta.name.SYS_DICT,
                component: () => import('@/views/sys/dict/index.vue'),
                meta: {
                    title: '字典管理',
                    icon: BookOutline,
                    permission: 'sys:dict',
                    actions: {
                        create: 'sys:dict:create',
                        update: 'sys:dict:update',
                        delete: 'sys:dict:delete',
                    }
                }
            }
        ]
    }
]

